<template>
<el-col :span="12">
  <div class="bg-purple-light">
          <div ref="chart1" style="height: 450px" class="w"></div>
        </div>
      </el-col>
</template>

<script>
import * as echarts from "echarts";
export default {
mounted(){
    var myChart1 = echarts.init(this.$refs.chart1);
    var option;

    option = {
      title: {
        text: "大笨钟邮局房产比例",
      },
      tooltip: {
        trigger: "item",
      },
      legend: {
        top: "5%",
        left: "center",
      },
      series: [
        {
          name: "Access From",
          type: "pie",
          radius: ["40%", "70%"],
          avoidLabelOverlap: false,
          label: {
            show: false,
            position: "center",
          },
          emphasis: {
            label: {
              show: true,
              fontSize: "40",
              fontWeight: "bold",
            },
          },
          labelLine: {
            show: false,
          },
          data: [
            { value: 1048, name: "公寓" },
            { value: 735, name: "住宅" },
            { value: 580, name: "商铺" },
          ],
        },
      ],
    };
    option && myChart1.setOption(option);
}
}
</script>

<style >

.w {
  width: 800px;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4);
  margin-top: 20px;
  border-radius: 5px;
}
</style>